﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bookkeeping.Core.Entities
{
    public class Tag : IIdentifiable
    {
        public virtual int Id { get; set; }
        public virtual string Name { get; set; }

        public Tag() {}

        public Tag(string name)
        {
            this.Name = name;
        }

        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return false;
            }

            Tag other = (Tag)obj;

            return Id == other.Id && Name == other.Name;
        }

        public override int GetHashCode()
        {
            return Id.GetHashCode();
        }

        public override string ToString()
        {
            return string.Format("Id: {0}, Name: {1}", Id, Name);
        }
    }
}
